package com.cuckoo.cuckoo_app2.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.cuckoo.cuckoo_app2.dao.Platform;
import com.cuckoo.cuckoo_app2.dao.SiteLink;
import com.cuckoo.cuckoo_app2.dao.TipsMessag;
import com.cuckoo.cuckoo_app2.dao.User;
import com.cuckoo.cuckoo_app2.dao.VersionControl;

import com.cuckoo.cuckoo_app2.greendao.PlatformDao;
import com.cuckoo.cuckoo_app2.greendao.SiteLinkDao;
import com.cuckoo.cuckoo_app2.greendao.TipsMessagDao;
import com.cuckoo.cuckoo_app2.greendao.UserDao;
import com.cuckoo.cuckoo_app2.greendao.VersionControlDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig platformDaoConfig;
    private final DaoConfig siteLinkDaoConfig;
    private final DaoConfig tipsMessagDaoConfig;
    private final DaoConfig userDaoConfig;
    private final DaoConfig versionControlDaoConfig;

    private final PlatformDao platformDao;
    private final SiteLinkDao siteLinkDao;
    private final TipsMessagDao tipsMessagDao;
    private final UserDao userDao;
    private final VersionControlDao versionControlDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        platformDaoConfig = daoConfigMap.get(PlatformDao.class).clone();
        platformDaoConfig.initIdentityScope(type);

        siteLinkDaoConfig = daoConfigMap.get(SiteLinkDao.class).clone();
        siteLinkDaoConfig.initIdentityScope(type);

        tipsMessagDaoConfig = daoConfigMap.get(TipsMessagDao.class).clone();
        tipsMessagDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        versionControlDaoConfig = daoConfigMap.get(VersionControlDao.class).clone();
        versionControlDaoConfig.initIdentityScope(type);

        platformDao = new PlatformDao(platformDaoConfig, this);
        siteLinkDao = new SiteLinkDao(siteLinkDaoConfig, this);
        tipsMessagDao = new TipsMessagDao(tipsMessagDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);
        versionControlDao = new VersionControlDao(versionControlDaoConfig, this);

        registerDao(Platform.class, platformDao);
        registerDao(SiteLink.class, siteLinkDao);
        registerDao(TipsMessag.class, tipsMessagDao);
        registerDao(User.class, userDao);
        registerDao(VersionControl.class, versionControlDao);
    }
    
    public void clear() {
        platformDaoConfig.clearIdentityScope();
        siteLinkDaoConfig.clearIdentityScope();
        tipsMessagDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
        versionControlDaoConfig.clearIdentityScope();
    }

    public PlatformDao getPlatformDao() {
        return platformDao;
    }

    public SiteLinkDao getSiteLinkDao() {
        return siteLinkDao;
    }

    public TipsMessagDao getTipsMessagDao() {
        return tipsMessagDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public VersionControlDao getVersionControlDao() {
        return versionControlDao;
    }

}
